Skip to content

Load Contexts in Analyser via entry points#763

Merged
tieneupin merged 8 commits intomainfrom
contexts-as-entry-points
Mar 24, 2026
Merged

Load Contexts in Analyser via entry points#763
tieneupin merged 8 commits intomainfrom
contexts-as-entry-points

Conversation

@tieneupin
Copy link
Contributor

We have reached a point in Murfey's development where some of the Context classes that can be attached to Murfey's Analyser class require additional dependencies not present in the default installation. To keep the client-side installation as lean as possible, we need to break the import chain by not importing all the Context classes upon initialisation of the Analyser. They should only be imported and attached to the Analyser once file analysis has determined which Context is needed for that particular session.

This PR accomplishes this by setting up the Context classes as entry points and loading the appropriate one once the Analyser has identified the appropriate context for the workflow.

@tieneupin tieneupin requested a review from d-j-hatton March 20, 2026 11:14
@tieneupin tieneupin self-assigned this Mar 20, 2026
@tieneupin tieneupin added bug Something isn't working client Relates to the client component dependencies labels Mar 20, 2026
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 29.82456% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.31%. Comparing base (cd967b5) to head (e30c942).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #763      +/-   ##
==========================================
- Coverage   49.46%   49.31%   -0.16%     
==========================================
  Files          92       92              
  Lines        9793     9815      +22     
  Branches     1283     1296      +13     
==========================================
- Hits         4844     4840       -4     
- Misses       4709     4725      +16     
- Partials      240      250      +10     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tieneupin tieneupin requested a review from stephen-riggs March 20, 2026 14:32
self._murfey_config,
self._token,
)
if context := _get_context("SPAMetadataContext"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a None catch here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've set it to continue if None is returned.

self._murfey_config,
self._token,
)
if context := _get_context("TomographyMetadataContext"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also None catch here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor

@stephen-riggs stephen-riggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the previous comments, looks good now

@tieneupin tieneupin merged commit b9108c9 into main Mar 24, 2026
17 checks passed
@tieneupin tieneupin deleted the contexts-as-entry-points branch March 24, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working client Relates to the client component dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants